/**
 * 打印模板实体
 * 
 * 1.同时支持报表模板及物流单模板。
 * 2.将内容分为header,footer,content三部分,可灵活针对分页显示。
 * 3.将同类属性封装为实体,可重用程度较高。
 * 4.节点类型可拓展性良好。
 * 
 */
var temp = {
    id: '001', //模板ID
    name: '顺丰快递', //模板名称
    type: 0, //模板类型：express;report
    printerName: "Microsoft XPS Document Writer", //默认打印机
    background: 'http://design.silkage.net/public/postpaper/zto.jpg', //模板背景url
    orientation: 0, //纸张方向
    printCopies: 1, //打印次数
    margin: {
        top: 0,
        left: 0
    }, //边距
    offset: {
        top: 0,
        left: 0
    }, //偏移
    size: {
        width: 230,
        height: 127
    }, // 大小
    header: {
        height: 100,
        showType: 0, //显示类型：首页显示;每页显示;
        nodes: [{
                type: 'label', //节点类型：标签
                field: 'sendcity', //绑定字段,
                default: '四川', //默认值
                desc: '发货城市', //字段描述
                display: 'block', //显示模式：默认null模式;block模式具有size和align属性;
                size: { width: 230, height: 170 }, //节点大小
                font: { name: 'Arial', size: 14, forecolor: 'red', underline: 0, italic: 0, weight: 0 }, //节点字体
                coordinate: { top: 5, left: 5 }, //节点坐标
                align: 'center' //对齐方式
            }, {
                type: 'barcode', //节点类型：条码
                barcodeType: 128, //条码类型
                field: 'postordernumber',
                desc: '电子单号条码',
                size: { width: 180, height: 60 },
                penPixel: 180, //像素,
                textPosition: 0, //条码文字位置
                font: { name: 'Arial', size: 14, forecolor: 'red', underline: 0, italic: 0, weight: 0 },
                coordinate: { top: 5, left: 5 },
                align: 'center'
            }, {
                type: 'qrcode', //节点类型：二维码
                field: 'wechat',
                default: '',
                desc: '微信公众号',
                size: { width: 230, height: 170 },
                coordinate: { top: 5, left: 5 }
            }, {
                type: 'image', //节点类型：图片
                imageType: 0, //图片类型：路径;图片url;
                field: 'logo',
                default: '',
                desc: 'LOGO',
                size: { width: 230, height: 170 },
                coordinate: { top: 5, left: 5 }
            }] //内容
    }, //头部
    footer: {
        height: 100,
        showType: 0, //显示类型：尾页显示;每页显示;
        nodes: [{
            type: 'label',
            field: 'sendcity',
            default: '四川',
            desc: '发货城市',
            display: 'block',
            size: { width: 230, height: 170 },
            font: { name: 'Arial', size: 14, forecolor: 'red', underline: 0, italic: 0, weight: 0 },
            coordinate: { top: 5, left: 5 },
            align: 'center'
        }]
    }, //尾部
    content: {
        style: 0, //表格样式
        pageSize: 0, //每页条目：0为自适应
        showTotal: true, //是否显示合计
        headrowHeight: 29, //标题行高
        rowHeight: 29, //行高
        nodes: [{
            field: 'index',
            default: '',
            size: { width: 30 },
            total: false, //是否加入合计
            font: { name: 'Arial', size: 14, forecolor: 'red', underline: 0, italic: 0, weight: 0 },
            align: 'center',
            head: {
                title: '序号',
                font: { name: 'Arial', size: 14, forecolor: 'red', underline: 0, italic: 0, weight: 0 },
                align: 'center'
            } //表头样式
        }, {
            field: 'price',
            default: '',
            size: { width: 30 },
            total: true,
            font: { name: 'Arial', size: 14, forecolor: 'red', underline: 0, italic: 0, weight: 0 },
            align: 'center',
            head: {
                title: '单价',
                font: { name: 'Arial', size: 14, forecolor: 'red', underline: 0, italic: 0, weight: 0 },
                align: 'center'
            }
        }]
    } //内容
};